﻿#include "AddOutput.h"
#include "Application.h"
#include "Output.h"

void AddOutputAction::Execute()
{
  _parser.SetPrefix("Outputs/");

  Configuration cfg;
  cfg.Add<Application*>("_app", &_app);
  cfg.Add<Parser*>("_parser", &_parser);

  auto type = cfg.Get<std::string>("type");
  _app.AddOutput(ObjectFactory::Make<Output>(type, cfg));

  Success("AddOutputAction");
}